/**
 * 
 */
package t4j.generics;

import static t4j.generics.watercolors.Watercolors.BRILLIANT_RED;
import static t4j.generics.watercolors.Watercolors.BURNT_UMBER;
import static t4j.generics.watercolors.Watercolors.CERULEAN_BLUE_HUE;
import static t4j.generics.watercolors.Watercolors.VIRIDIAN_HUE;
import static t4j.net.mindview.util.Sets.complement;
import static t4j.net.mindview.util.Sets.difference;
import static t4j.net.mindview.util.Sets.intersection;
import static t4j.net.mindview.util.Sets.union;

import java.util.EnumSet;
import java.util.Set;

import t4j.generics.watercolors.Watercolors;

public class WatercolorSets {

	public static void main(String[] args) {
		//泛型参数是enum类型
		Set<Watercolors> set1 = EnumSet.range(BRILLIANT_RED, VIRIDIAN_HUE);
		
		Set<Watercolors> set2 = EnumSet.range(CERULEAN_BLUE_HUE, BURNT_UMBER);
		
		System.out.println("set1:" + set1);
		
		System.out.println("set2:" + set2);
		
		System.out.println("union(set,set2): " + union(set1, set2));
		
		Set<Watercolors> subset = intersection(set1, set2);
		
		System.out.println("intersetion(set1,set2)" +  subset);
		
		System.out.println("difference(set1,subset):" + difference(set1, subset));
		
		System.out.println("difference(set2,subset):" + difference(set2, subset));
		
		System.out.println("complement(set1, set2)" + complement(set1, set2));
	}
}
